#include <iostream>
#include <string>
#include <ctemplate/template.h>

const std::string path = "./ctpl.html";

int main()
{
    // 1. 构建字典
    ctemplate::TemplateDictionary dict("html"); // unordered_map

    // 2. 在字典中插入value
    dict.SetValue("key1", "baichen");
    dict.SetValue("key2", "dada");

    // 3. 获取被渲染的html
    ctemplate::Template* tpl = ctemplate::Template::GetTemplate(path, ctemplate::DO_NOT_STRIP);

    // 4. 渲染html
    std::string html;
    tpl->Expand(&html, &dict);

    std::cout << html << std::endl;

    return 0;
}